/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author cegarciaa
 */
@Entity
@Table(name = "variablef")
@NamedQueries({
    @NamedQuery(name = "Variablef.findAll", query = "SELECT v FROM Variablef v"),
    @NamedQuery(name = "Variablef.findByIdvarf", query = "SELECT v FROM Variablef v WHERE v.idvarf = :idvarf"),
    @NamedQuery(name = "Variablef.findByNombre", query = "SELECT v FROM Variablef v WHERE v.nombre = :nombre")})
public class Variablef implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IDVARF")
    private Long idvarf;
    @Column(name = "NOMBRE")
    private String nombre;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "variablef")
    private List<Varfd> varfdList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idvarf")
    private List<Alarmavariable> alarmaList;

    public Variablef() {
    }

    public Variablef(Long idvarf) {
        this.idvarf = idvarf;
    }

    public Long getIdvarf() {
        return idvarf;
    }

    public void setIdvarf(Long idvarf) {
        this.idvarf = idvarf;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public List<Varfd> getVarfdList() {
        return varfdList;
    }

    public void setVarfdList(List<Varfd> varfdList) {
        this.varfdList = varfdList;
    }

    public List<Alarmavariable> getAlarmaList() {
        return alarmaList;
    }

    public void setAlarmaList(List<Alarmavariable> alarmaList) {
        this.alarmaList = alarmaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idvarf != null ? idvarf.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Variablef)) {
            return false;
        }
        Variablef other = (Variablef) object;
        if ((this.idvarf == null && other.idvarf != null) || (this.idvarf != null && !this.idvarf.equals(other.idvarf))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Variablef[idvarf=" + idvarf + "]";
    }
}
